package org.inspursc.s0517.health.evaluation.dao;

import org.inspursc.s0517.health.evaluation.entity.InsSurveyAnswer;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;
import java.util.List;

/**
 * for institution assessment
 */
public interface InsSurveyAnswerDao extends JpaRepository<InsSurveyAnswer, Integer> {

    //find by survey id and oraganization id
    InsSurveyAnswer findBySurveyIdAndOrganizationId(Integer surveyId, Integer oganizationId);

    //find by organization id
    List<InsSurveyAnswer> findAllByOrganizationId(Integer organizationId);

    //find by appraiser id and date
    List<InsSurveyAnswer> findAllByAppraiserIdAndDateTime(Integer appraiserId, Date dateTime);

    List<InsSurveyAnswer> findAllByOrganizationIdAndAppraiserIdAndDateTime(Integer organizationId, Integer appraiserId, Date dateTime);

}
